<?php


namespace App\Controller;

use Hyperf\Config\Annotation\Value;
use Hyperf\Contract\ConfigInterface;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\AutoController;

/**
 * @AutoController()
 * Class Demo03Controller
 * @package App\Controller
 */
class Demo03Controller
{
    /**
     * @Inject()
     * @var ConfigInterface
     */
    private $config;

    /**
     * @Value("databases.default.charset")
     */
    private $charset;

    public function inject(){
        $result[] = $this->config->get('foo.bar','xx');
        $result[] = $this->config->get('fuck.baz', 'oo');
        return $result;
    }

    public function value(){
        return $this->charset;
    }

    public function config(){
        return config('databases.default.collation', 'not data');
    }
}